#!/bin/bash

if [[ "$1" == "" ]] ; then
    echo Input Parameter is directory for test files
    exit 2
fi
testdir=/"$1"
set -e
mkdir -p "$testdir"/video1
mkdir -p "$testdir"/video2
mkdir -p "$testdir"/video3

if [[ -d /mnt/video1 ]] ; then
    sudo rmdir /mnt/video1
fi
if [[ -d /mnt/video2 ]] ; then
    sudo rmdir /mnt/video1
fi
if [[ -d /mnt/video3 ]] ; then
    sudo rmdir /mnt/video1
fi

sudo ln -fs "$testdir"/video1 /mnt/video1
sudo ln -fs "$testdir"/video2 /mnt/video2
sudo ln -fs "$testdir"/video3 /mnt/video3

mkdir -p /mnt/video1/artwork
mkdir -p /mnt/video1/banners 
mkdir -p /mnt/video1/coverart 
mkdir -p /mnt/video2/dbbackup 
mkdir -p /mnt/video1/fanart 
mkdir -p /mnt/video1/recordings 
mkdir -p /mnt/video2/recordings 
mkdir -p /mnt/video3/recordings 
mkdir -p /mnt/video1/screenshots 
mkdir -p /mnt/video1/trailers 

